]> dgit.raspbian.org Git - gnome-shell.git/commit
st/theme-node: Forget properties cache on stylesheet change
authorDaniel van Vugt <daniel.van.vugt@canonical.com>
Thu, 28 Mar 2024 06:45:26 +0000 (14:45 +0800)
committerSimon McVittie <smcv@debian.org>
Thu, 12 Jun 2025 20:08:12 +0000 (21:08 +0100)
commitfd6fd17d982b0f7aedb44167b29f844d2d1424fd
tree15f82da9df14c8b5b35b35ef2ec25a07c18ede1d
parentda29c05904ef6560e21b04c62d4906ba11c278b0
st/theme-node: Forget properties cache on stylesheet change

To avoid `node->properties` pointing to freed memory after each
`st_theme_unload_stylesheet`, flush the cache that is `node->properties`.
They will be reloaded as soon as they are required by `ensure_properties`.

And yes `node->stylesheets_changed_id` already existed, but was unused.

Why not just fix Croco? Croco does not use proper reference counting
everywhere it should, and retrofitting it would be difficult due to the
recursive nature of `CRDeclaration`.

Includes commit:
st/theme-node: Forget properties cache before unref'ing the theme
Which the properties point into.

Forwarded: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3252
Bug: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7339
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2069559
Bug-Dash-to-Dock: https://github.com/micheleg/dash-to-dock/issues/2179

Gbp-Pq: Name st-theme-node-Forget-properties-cache-on-stylesheet-chang.patch
src/st/st-theme-node-private.h
src/st/st-theme-node.c